package com.defect.controller.statistics;

import com.defect.bo.ResultBo;
import com.defect.service.statisticsService.SSeverityService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Date;

@RestController
@RequestMapping("severity")
public class SSeverityController {
    @Resource
    private SSeverityService severityService;

    /**
     * 带条件查询每种缺陷严重程度的数量
     * @param id 项目id
     * @param date1 起始时间
     * @param date2 最后时间
     * @return 返回实体类集合，属性count1：缺陷严重程度的数量，属性severityDesc：缺陷严重程度描述
     * @throws Exception
     */
    @RequestMapping("count")
    public ResultBo selectSeverityCount(Integer id, Date date1, Date date2) throws Exception {
        return new ResultBo("200","success",null,severityService.selectSeverityCount(id,date1,date2));
    }
}
